#!/bin/bash
cd src
tar jxvf jemalloc-4.5.0.tar.bz2
cd jemalloc-4.5.0
LDFLAGS="${LDFLAGS} -lrt" ./configure
make
make install
unset LDFLAGS
if [ -f "/usr/local/lib/libjemalloc.so" ]; then
ln -s /usr/local/lib/libjemalloc.so.2 /usr/lib64/libjemalloc.so.1
echo '/usr/local/lib' > /etc/ld.so.conf.d/local.conf
ldconfig
echo "${CSUCCESS}jemalloc module installed successfully! ${CEND}"
fi
cd ../..

